<?php


$objMerk = new Merk();
$keamanan = new amankanParam();
$paramGet = $keamanan->getMethod();
if (isset($paramGet['on'])) {
    $posisi = $paramGet['on'];
    if ($posisi == 'simpan') {
        $paramPost = $keamanan->postMethod();
        $paramPost['aktif'] = isset($paramPost['aktif'])?$paramPost['aktif']:0;
        $idKat = $paramPost['id'];
        unset($paramPost['id']);
        if($idKat==''){
            $objMerk->create($paramPost);
        }
        else{
            $objMerk->update($paramPost, array('id'=>$idKat));
        };
        $res= $objMerk->execute();
        echo json_encode($res);
    }//eof simpan
}
else{
    $ar=array('success'=>false,'error_msg'=>'Not Allowed For Direct');
    echo json_encode($ar);
    
}


